# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>

pkgname=p2pool
pkgver=3.9
_commit=a8582b2a0f469976bb5e0437c1d20df04e8263a0
pkgrel=1
pkgdesc='Decentralized pool for Monero mining'
arch=('loong64' 'x86_64')
license=('GPL-3.0-or-later')
url="https://github.com/SChernykh/p2pool"
depends=(
  'libcurl.so'
  'libuv'
  'libzmq.so'
)
makedepends=('cmake' 'git')
source=("${pkgname}"::"git+https://github.com/SChernykh/${pkgname}#commit=${_commit}")
b2sums=('SKIP')
options=(!lto)

prepare() {
  cd ${pkgname}
  git submodule init
  git submodule update
  mkdir -p build
}

build() {
  cd ${pkgname}/build
  cmake .. -DCMAKE_BUILD_TYPE=Release
  make -j$(nproc)
}

check() {
  cd ${pkgname}
  ./build/p2pool --help
}

package() {
  cd ${pkgname}
  install -Dm775 "build/p2pool" -t "${pkgdir}/usr/bin"
}

# vim: ts=2 sw=2 et:
